home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 49 / Amiga Format CD49 (2000-01-17)(Future Publishing)(GB)(Track 1 of 3)[!][issue 2000-02].iso / -websites- / wirenet / files / updatewirenet.lzx / UpdateWirenet next >
Text File  |  1998-02-03  |  5KB  |  169 lines

  1. ; $VER: UpdateWirenet 1.0 (07.06.96) Amiga Neil Bothwick
  2. ;
  3. ; Parts of this installer are based on the installation routines for the
  4. ; individual software items, the rest is (c) Neil Bothwick, Wirenet Amiga
  5. ; Internet and may not be used in any other package without permission
  6.  
  7.  
  8. ;========================== Define Procedures ==========================
  9.  
  10. (set ArcName 'UpdateWirenet.lzx')
  11. ;;; Abort with message
  12. (procedure GetOut GetOutMsg
  13.         (message GetOutMsg)
  14.         (exit (quiet))
  15. )
  16. ;;;
  17. ;;; Check archive was unarced correctly
  18. (procedure CheckUnarc
  19.     (if (= 0 (exists 'Updates/Dashboard'))
  20.         (GetOut
  21.             (cat
  22.                 '\n' ArcName 'has not been unarchived correctly!\n\n'
  23.                 'Type\n\n"unlzx x ' ArcName ' RAM:"\n\nin a shell and then '
  24.                 'double click on the installer icon in RAM:'
  25.             )
  26.         )
  27.     )
  28. )
  29. ;;;
  30. ;;; Get version of program
  31. (procedure Version filename
  32.     (set vernum (getversion filename))
  33.     (set ver (/ vernum 65536))
  34.     (set rev (- vernum (* ver 65536)))
  35.     (set return ('%ld.%ld' ver rev))
  36. )
  37. ;;;
  38. ;;; Create environment variable
  39. (procedure SetEnv EnvName EnvVal                                ; Creates environment variables in ENV: and ENVARC:
  40.     (set ArcName (tackon 'ENVARC:' EnvName))
  41.     (if (exists ArcName)                                        ; Back it up if it already exists,
  42.         (if (not (exists (cat ArcName '.old')))                 ; has not been previously backed up
  43.             (if (not(= EnvVal (getenv EnvName)))                ; and is not the same value
  44.                 (rename ArcName (cat ArcName '.old'))
  45.             )
  46.         )
  47.     )
  48.     (textfile
  49.         (dest (tackon 'ENVARC:' EnvName))
  50.         (append EnvVal)
  51.     )
  52.     (textfile
  53.         (dest (tackon 'ENV:' EnvName))
  54.         (append EnvVal)
  55.     )
  56. )
  57. ;;;
  58. ;;; Install New Dashboard
  59. (procedure InstallDashboard
  60.     (rename 'AmiTCP:Dashboard' 'AmiTCP:Dashboard.old')
  61.     (copyfiles
  62.         (prompt 'Copying new Dashboard script')
  63.         (help @copyfiles-help)
  64.         (source 'Updates')
  65.         (pattern 'Dashboar#?')
  66.         (dest 'AmiTCP:')
  67.     )
  68.     (protect 'AmiTCP:Dashboard' '+s')
  69. )
  70. ;;;
  71. ;;; Install New Connect
  72. (procedure InstallConnect
  73.     (rename 'AmiTCP:bin/Connect' 'AmiTCP:bin/Connect.old')
  74.     (copyfiles
  75.         (prompt 'Copying new Connect script')
  76.         (help @copyfiles-help)
  77.         (source 'Updates/Connect')
  78.         (dest 'AmiTCP:bin')
  79.     )
  80.     (protect 'AmiTCP:bin/Connect' '+s')
  81. )
  82. ;;;
  83. ;;; Install Fetch
  84. (procedure InstallFetch
  85.     (set
  86.         Password
  87.             (askstring
  88.                 (prompt '\nPlease enter your password')
  89.                 (help @askstring-help)
  90.             )
  91.     )
  92.     (rename 'AmiTCP:bin/Fetch' 'AmiTCP:bin/Fetch.old')
  93.     (textfile
  94.         (dest 'AmiTCP:bin/Fetch')
  95.         (include 'Updates/Fetch.head')
  96.         (append "Password   = '" Password "'                         /* Your email password */\n")
  97.         (include 'Updates/Fetch.body')
  98.     )
  99.     (protect 'AmiTCP:bin/Fetch' '+s')
  100. )
  101. ;;;
  102. ;;; Install SendEvents
  103. (procedure InstallSendEvents
  104.     (rename 'AmiTCP:bin/SendEvents' 'AmiTCP:bin/SendEvents.old')
  105.     (copyfiles
  106.         (prompt 'Copying new SendEvents script')
  107.         (help @copyfiles-help)
  108.         (source 'Updates/SendEvents')
  109.         (dest 'AmiTCP:bin')
  110.     )
  111.     (protect 'AmiTCP:bin/SendEvents' '+s')
  112. )
  113. ;;;
  114. ;;; Install StopNet
  115. (procedure InstallStopNet
  116.     (rename 'AmiTCP:bin/StopNet' 'AmiTCP:bin/StopNet.old')
  117.     (copyfiles
  118.         (prompt 'Copying new StopNet script')
  119.         (help @copyfiles-help)
  120.         (source 'Updates/StopNet')
  121.         (dest 'AmiTCP:bin')
  122.     )
  123.     (protect 'AmiTCP:bin/StopNet' '+s')
  124. )
  125. ;;;
  126. ;;; Copy docs
  127. (procedure CopyDocs
  128.     (copyfiles
  129.         (source 'Updates')
  130.         (dest 'amiTCP:doc')
  131.         (pattern '#?.guide')
  132.         (prompt '')
  133.         (help '')
  134.     )
  135. )
  136. ;;;
  137.  
  138. (CheckUnarc)                ; ensure archive was unpacked with paths preserved
  139. (welcome)
  140.  
  141. (if (>= (Version 'AmiTCP:Dashboard') (Version 'Updates/Dashboard'))
  142.     (message '\n\nYou already have the latest Dashboard')
  143.     (InstallDashboard)
  144. )
  145. (if (>= (Version 'AmiTCP:bin/Connect') (Version 'Updates/Connect'))
  146.     (message '\n\nYou already have the latest Connect')
  147.     (InstallConnect)
  148. )
  149. (if (>= (Version 'AmiTCP:bin/Fetch') (Version 'Updates/Fetch.head'))
  150.     (message '\n\nYou already have the latest Fetch')
  151.     (InstallFetch)
  152. )
  153. (if (>= (Version 'AmiTCP:bin/SendEvents') (Version 'Updates/SendEvents'))
  154.     (message '\n\nYou already have the latest SendEvents')
  155.     (InstallSendEvents)
  156. )
  157. (if (>= (Version 'AmiTCP:doc/Wirenet.guide') (Version 'Updates/Wirenet.guide'))
  158.     (message '\n\nYou already have the latest Wirenet.guide')
  159.     (CopyDocs)
  160. )
  161. (InstallStopNet)
  162. (SetEnv 'MAILSERVER' 'mail.u-net.com')
  163. (SetEnv 'NEWSSERVER' 'news.u-net.com')
  164. (SetEnv 'MAILBOX' (cat (getenv 'USERNAME') '-' (getenv 'NODENAME')))
  165.  
  166. (message '\n\nThe updated Wirenet software has now been installed.')
  167. (exit (quiet))
  168.  
  169.